package com.gzy.rpsm_admin.mapper;

import com.github.pagehelper.Page;
import com.gzy.rpsm_admin.pojo.Floor;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface FloorMapper {
    @Select("<script>select * from floor <where><if test='number != null and number !=\"\"'>floor_number " +
            "like concat('%',#{number},'%')</if></where></script>")
    Page<Floor> findAllFloor(@Param("number") String number);


    @Select("select floor_id from floor where floor_id = #{id}")
    String queryFloorById(Integer id);

    @Select("select belong_building from floor where floor_id = #{id}")
    Integer queryBuildingById(Integer id);

}
